package kz.pompei.ifacer.model.widgets;

import java.io.PrintStream;
import java.util.UUID;

public class WidgetText extends Widget {
  public String text;
  
  @Override
  protected void printFields(int offset, PrintStream out) {
    String s = space(offset);
    out.println(s + "<text><![CDATA[" + text + "]]></text>");
  }
  
  public WidgetText(UUID uuid) {
    super(uuid);
  }
  
  public WidgetText() {}
  
  @Override
  public Widget copy() {
    WidgetText ret = new WidgetText(uuid);
    assignTo(ret);
    return ret;
  }
  
  @Override
  public void assignTo(Widget widget) {
    checkWidget(widget, getClass());
    super.assignTo(widget);
    WidgetText w = (WidgetText)widget;
    w.text = text;
  }
}
